package com.example.back.mapper;

import com.example.back.entity.vo.UserVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

@Mapper
public interface UserAnalysisMapper {

    ArrayList<UserVo> getUserAnalysis();
    @Select("SELECT DATE_FORMAT(zcsj, '%Y-%m') as zcsj,count(*) as count FROM user GROUP BY DATE_FORMAT(zcsj, '%Y-%m') ORDER BY zcsj DESC; ")
    ArrayList<UserVo> getUserAnalysisByTime();
    @Select("SELECT sex,count(*) as count FROM user GROUP BY sex; ")
    ArrayList<UserVo> getUserAnalysisBySex();
}
